<?php
if(!defined('IN_PHPSCUP'))exit('hacking'); 
class DefaultApp extends BaseApp
{
    function index()
    { 
	    $companyid = '';
		if(isset($_GET['companyid']))
		{
	    $companyid = $_GET['companyid']; 		
		}
	    
	    $setlang = '';
		if(isset($_GET['langid']))
		{
	    $setlang = $_GET['langid']; 		
		}

        if(!empty($setlang))
		{
				  if(preg_match("/[.\/]/",$setlang))
		          {
		            $GLOBALS['Lang']->_lang_tp = LANG;
		  
                  } 
				  else
				  {
				  $GLOBALS['Lang']->_lang_tp = $setlang;				  
				  }
		          $GLOBALS['Lang']->_set_lang($GLOBALS['Lang']->_lang_tp);
		}
		$GLOBALS['Lang']->_get_lang('default');	
		
		$TB_nav = &$this->_model('nav');	 
		
		$navdata = $TB_nav->show(COMPANY_ID);
		foreach($navdata as $key => $value)
		{
		 unset($navdata[$key]['config']);				
         $navdata[$key]['config'] = @unserialize($value['config']);		
		}			
		
        $this->assign('navigation', $navdata);	
		$companydata = $TB_nav->companymsg(COMPANY_ID);			
        $this->assign('companydata', $companydata);	
		$TB_new = &$this->_model('new');				
		$data_index_new = $TB_new->isindex(COMPANY_ID);		
        $this->assign('data_index_new', $data_index_new);		

		$TB_job = &$this->_model('job');				
		$data_index_job = $TB_job->inindex(COMPANY_ID);		
        $this->assign('data_index_job', $data_index_job);	
		
		$TB_prot = &$this->_model('prot');				
		$data_index_prot = $TB_prot->inindex(COMPANY_ID);		
        $this->assign('data_index_prot', $data_index_prot);	
	    
        $this->assign('view_charset', VIEW_CHARSET);
        $this->assign('companyid',COMPANY_ID);	
						
        $this->assign('site_url', SITE_URL);
				
        $this->assign('page_title', SITE_TITLE);
        $this->assign('page_description', SITE_DESCRIPTION);
        $this->assign('page_keywords', SITE_KEYWORDS);
		$this->assign('bg_pic_url',SITE_URL.'/'.$GLOBALS['SCup']->SCup_name.'/view/'.VIEW_TYPE .'/style/'.CSS_TYPE.'/');
        $this->assign('login_icon', $GLOBALS['SCup']->SCup_user_checking);		

		
        $this->display('index.view.html');
    }
  
    function yzimage()
    {		
      include(ROOT_PATH ."/lib/image.lib.php");
      $string_yzimg=check_rand(4);
      set_cookie("yzImgNum","$string_yzimg", 0,COOKIE_PATH, COOKIE_DOMAIN, false);
	  $GLOBALS['SCup']->SCup_user_msg['data']['yzImgNum'] = $string_yzimg; 

      Image:: check_img($string_yzimg); 
    }	
   
}






?>